dojo.require("esri.map");
/////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////加载谷歌新地图有偏移
dojo.declare("GoogleMapLayer", esri.layers.TiledMapServiceLayer,{ // create WMTSLayer by extending esri.layers.TiledMapServiceLayer
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102113
        });
        this.initialExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference);
        this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference);
        //
        this.tileInfo = new esri.layers.TileInfo({
            "dpi": "90.71428571427429",
            "format": "image/png",
            "compressionQuality": 0,
            "spatialReference": {
                "wkid": "3857"
            },
            "rows": 256,
            "cols": 256,
            "origin": {
                "x": -20037508.342787,
                "y": 20037508.342787
            },

            // Scales in DPI 96
            "lods": [{
                "level": 0,
                "scale": 591657527.591555,
                "resolution": 156543.033928
            }, {
                "level": 1,
                "scale": 295828763.795777,
                "resolution": 78271.5169639999
            }, {
                "level": 2,
                "scale": 147914381.897889,
                "resolution": 39135.7584820001
            }, {
                "level": 3,
                "scale": 73957190.948944,
                "resolution": 19567.8792409999
            }, {
                "level": 4,
                "scale": 36978595.474472,
                "resolution": 9783.93962049996
            }, {
                "level": 5,
                "scale": 18489297.737236,
                "resolution": 4891.96981024998
            }, {
                "level": 6,
                "scale": 9244648.868618,
                "resolution": 2445.98490512499
            }, {
                "level": 7,
                "scale": 4622324.434309,
                "resolution": 1222.99245256249
            }, {
                "level": 8,
                "scale": 2311162.217155,
                "resolution": 611.49622628138
            }, {
                "level": 9,
                "scale": 1155581.108577,
                "resolution": 305.748113140558
            }, {
                "level": 10,
                "scale": 577790.554289,
                "resolution": 152.874056570411
            }, {
                "level": 11,
                "scale": 288895.277144,
                "resolution": 76.4370282850732
            }, {
                "level": 12,
                "scale": 144447.638572,
                "resolution": 38.2185141425366
            }, {
                "level": 13,
                "scale": 72223.819286,
                "resolution": 19.1092570712683
            }, {
                "level": 14,
                "scale": 36111.909643,
                "resolution": 9.55462853563415
            }, {
                "level": 15,
                "scale": 18055.954822,
                "resolution": 4.77731426794937
            }, {
                "level": 16,
                "scale": 9027.977411,
                "resolution": 2.38865713397468
            }, {
                "level": 17,
                "scale": 4513.988705,
                "resolution": 1.19432856685505
            }, {
                "level": 18,
                "scale": 2256.994353,
                "resolution": 0.597164283559817
            }, {
                "level": 19,
                "scale": 1128.497176,
                "resolution": 0.298582141647617
            }]
        });
        this.loaded = true;
        this.onLoad(this);
    },
    getTileUrl: function(level, row, col) {
        return "http://mt" + (col % 4) + ".google.cn/vt/lyrs=s@112&hl=zh-CN&gl=cn&" + "x=" + col + "&" +
            "y=" +
            row +
            "&" +
            "z=" +
            level +
            "&s=";
    }
});

dojo.declare("GoogleMapAnooLayer", esri.layers.TiledMapServiceLayer, { // create WMTSLayer by extending esri.layers.TiledMapServiceLayer
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102113
        });
        this.initialExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference);
        this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference);
        //
        this.tileInfo = new esri.layers.TileInfo({
            "dpi": "90.71428571427429",
            "format": "image/png",
            "compressionQuality": 0,
            "spatialReference": {
                "wkid": "3857"
            },
            "rows": 256,
            "cols": 256,
            "origin": {
                "x": -20037508.342787,
                "y": 20037508.342787
            },

            // Scales in DPI 96
            "lods": [{
                "level": 0,
                "scale": 591657527.591555,
                "resolution": 156543.033928
            }, {
                "level": 1,
                "scale": 295828763.795777,
                "resolution": 78271.5169639999
            }, {
                "level": 2,
                "scale": 147914381.897889,
                "resolution": 39135.7584820001
            }, {
                "level": 3,
                "scale": 73957190.948944,
                "resolution": 19567.8792409999
            }, {
                "level": 4,
                "scale": 36978595.474472,
                "resolution": 9783.93962049996
            }, {
                "level": 5,
                "scale": 18489297.737236,
                "resolution": 4891.96981024998
            }, {
                "level": 6,
                "scale": 9244648.868618,
                "resolution": 2445.98490512499
            }, {
                "level": 7,
                "scale": 4622324.434309,
                "resolution": 1222.99245256249
            }, {
                "level": 8,
                "scale": 2311162.217155,
                "resolution": 611.49622628138
            }, {
                "level": 9,
                "scale": 1155581.108577,
                "resolution": 305.748113140558
            }, {
                "level": 10,
                "scale": 577790.554289,
                "resolution": 152.874056570411
            }, {
                "level": 11,
                "scale": 288895.277144,
                "resolution": 76.4370282850732
            }, {
                "level": 12,
                "scale": 144447.638572,
                "resolution": 38.2185141425366
            }, {
                "level": 13,
                "scale": 72223.819286,
                "resolution": 19.1092570712683
            }, {
                "level": 14,
                "scale": 36111.909643,
                "resolution": 9.55462853563415
            }, {
                "level": 15,
                "scale": 18055.954822,
                "resolution": 4.77731426794937
            }, {
                "level": 16,
                "scale": 9027.977411,
                "resolution": 2.38865713397468
            }, {
                "level": 17,
                "scale": 4513.988705,
                "resolution": 1.19432856685505
            }, {
                "level": 18,
                "scale": 2256.994353,
                "resolution": 0.597164283559817
            }, {
                "level": 19,
                "scale": 1128.497176,
                "resolution": 0.298582141647617
            }]
        });
        this.loaded = true;
        this.onLoad(this);
    },
    getTileUrl: function(level, row, col) {
        return "http://mt" + (col % 4) + ".google.cn/vt/lyrs=h@177000000&hl=zh-CN&gl=cn&" + "x=" + col + "&" +
            "y=" +
            row +
            "&" +
            "z=" +
            level +
            "&s=";
    }
});
///////////////////////////////////////加载谷歌新地图有偏移
//加载假三维
dojo.declare("EDS", esri.layers.TiledMapServiceLayer, {
    _subDomains: new Array("khm0", "khm1", "khm2", "khm3"),
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102100
        });
        this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference));

        this.id = 'googleimg';
        this.tileInfo = new esri.layers.TileInfo({
            "rows": 256,
            "cols": 256,
            "compressionQuality": 0,
            "origin": {
                "x": -20037508.342787,
                "y": 20037508.342787
            },
            "spatialReference": {
                "wkid": 102100
            },
            "lods": [{
                "level": 0,
                "resolution": 156543.033928,
                "scale": 591657527.591555
            }, {
                "level": 1,
                "resolution": 78271.5169639999,
                "scale": 295828763.795777
            }, {
                "level": 2,
                "resolution": 39135.7584820001,
                "scale": 147914381.897889
            }, {
                "level": 3,
                "resolution": 19567.8792409999,
                "scale": 73957190.948944
            }, {
                "level": 4,
                "resolution": 9783.93962049996,
                "scale": 36978595.474472
            }, {
                "level": 5,
                "resolution": 4891.96981024998,
                "scale": 18489297.737236
            }, {
                "level": 6,
                "resolution": 2445.98490512499,
                "scale": 9244648.868618
            }, {
                "level": 7,
                "resolution": 1222.99245256249,
                "scale": 4622324.434309
            }, {
                "level": 8,
                "resolution": 611.49622628138,
                "scale": 2311162.217155
            }, {
                "level": 9,
                "resolution": 305.748113140558,
                "scale": 1155581.108577
            }, {
                "level": 10,
                "resolution": 152.874056570411,
                "scale": 577790.554289
            }, {
                "level": 11,
                "resolution": 76.4370282850732,
                "scale": 288895.277144
            }, {
                "level": 12,
                "resolution": 38.2185141425366,
                "scale": 144447.638572
            }, {
                "level": 13,
                "resolution": 19.1092570712683,
                "scale": 72223.819286
            }, {
                "level": 14,
                "resolution": 9.55462853563415,
                "scale": 36111.909643
            }, {
                "level": 15,
                "resolution": 4.77731426794937,
                "scale": 18055.954822
            }, {
                "level": 16,
                "resolution": 2.38865713397468,
                "scale": 9027.977411
            }, {
                "level": 17,
                "resolution": 1.19432856685505,
                "scale": 4513.988705
            }, {
                "level": 18,
                "resolution": 0.597164283559817,
                "scale": 2256.994353
            }, { "level": 19, "resolution": 0.298582141647617, "scale": 1128.497176 }]
        });

        this.loaded = true;
        this.onLoad(this);
    },

    getTileUrl: function(level, row, col) {
        var url = "";
        if (level == 0) {
            url = "http://hbpic2.go2map.com/seamless1/xian/mappic/png" + (3 - level) + "/" + (col - 25) + "," + (row - 25) + ".png";
        }
        if (level == 1) {
            url = "http://hbpic2.go2map.com/seamless1/xian/mappic/png" + (3 - level) + "/" + (col - 50) + "," + (row - 50) + ".png";
        }
        if (level == 2) {
            url = "http://hbpic2.go2map.com/seamless1/xian/mappic/png" + (3 - level) + "/" + (col - 100) + "," + (row - 100) + ".png";
        }
        if (level == 3) {
            url = "http://hbpic2.go2map.com/seamless1/xian/mappic/png" + (3 - level) + "/" + (col - 200) + "," + (row - 200) + ".png";
        }
        return url;
        //http://hbpic2.go2map.com/seamless1/xian/mappic/png0/46,44.jpg
        //var subdomain = this._subDomains[(level + col + row) % this._subDomains.length];
        //return "http://" + subdomain + ".googleapis.com/kh?v=143\u0026hl=zh-CN\u0026?&z=" + level + "&x=" + col + "&y=" + row;
    }
});
//加载搜狗卫星图
dojo.declare("sogouimg", esri.layers.TiledMapServiceLayer, {
    _subDomains: new Array("khm0", "khm1", "khm2", "khm3"),
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102100
        });
        this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference));

        this.id = 'googleimg';
        this.tileInfo = new esri.layers.TileInfo({
            "rows": 256,
            "cols": 256,
            "compressionQuality": 0,
            "origin": {
                "x": -20037508.342787,
                "y": 20037508.342787
            },
            "spatialReference": {
                "wkid": 102100
            },
            "lods": [{
                "level": 0,
                "resolution": 156543.033928,
                "scale": 591657527.591555
            }, {
                "level": 1,
                "resolution": 78271.5169639999,
                "scale": 295828763.795777
            }, {
                "level": 2,
                "resolution": 39135.7584820001,
                "scale": 147914381.897889
            }, {
                "level": 3,
                "resolution": 19567.8792409999,
                "scale": 73957190.948944
            }, {
                "level": 4,
                "resolution": 9783.93962049996,
                "scale": 36978595.474472
            }, {
                "level": 5,
                "resolution": 4891.96981024998,
                "scale": 18489297.737236
            }, {
                "level": 6,
                "resolution": 2445.98490512499,
                "scale": 9244648.868618
            }, {
                "level": 7,
                "resolution": 1222.99245256249,
                "scale": 4622324.434309
            }, {
                "level": 8,
                "resolution": 611.49622628138,
                "scale": 2311162.217155
            }, {
                "level": 9,
                "resolution": 305.748113140558,
                "scale": 1155581.108577
            }, {
                "level": 10,
                "resolution": 152.874056570411,
                "scale": 577790.554289
            }, {
                "level": 11,
                "resolution": 76.4370282850732,
                "scale": 288895.277144
            }, {
                "level": 12,
                "resolution": 38.2185141425366,
                "scale": 144447.638572
            }, {
                "level": 13,
                "resolution": 19.1092570712683,
                "scale": 72223.819286
            }, {
                "level": 14,
                "resolution": 9.55462853563415,
                "scale": 36111.909643
            }, {
                "level": 15,
                "resolution": 4.77731426794937,
                "scale": 18055.954822
            }, {
                "level": 16,
                "resolution": 2.38865713397468,
                "scale": 9027.977411
            }, {
                "level": 17,
                "resolution": 1.19432856685505,
                "scale": 4513.988705
            }, {
                "level": 18,
                "resolution": 0.597164283559817,
                "scale": 2256.994353
            }, { "level": 19, "resolution": 0.298582141647617, "scale": 1128.497176 }]
        });

        this.loaded = true;
        this.onLoad(this);
    },

    getTileUrl: function(zoom, row, col) {
        zoom = zoom - 2;

        var offsetX = Math.pow(2, zoom);
        var offsetY = offsetX - 1;

        var numX = col - offsetX;
        var numY = (-row) + offsetY;

        zoom = zoom + 1;

        var l = 729 - zoom;
        if (l == 710) l = 792;

        var blo = Math.floor(numX / 200);
        var bla = Math.floor(numY / 200);

        var blos, blas;
        if (blo < 0)
            blos = (-blo);
        else
            blos = "" + blo;
        if (bla < 0)
            blas = (-bla);
        else
            blas = "" + bla;

        var x = numX.toString().replace("-", "M");
        var y = numY.toString().replace("-", "M");

        //var num = (row+col) % tileUrls.length;
        //trace(l+" row:"+blos+" col: "+blas+" x: "+x+" y: "+y);

        var strURL = "";
        strURL = "http://hbpic2.go2map.com/seamless/0/180/" + l + "/" + blos + "/" + blas + "/" + x + "_" + y + ".JPG";
        return strURL;
        //http://hbpic2.go2map.com/seamless/0/180/792/485/161/97033_32303.JPG
    }
});
//加载谷歌影像
dojo.declare("googleimg", esri.layers.TiledMapServiceLayer, {
    _subDomains: new Array("khm0", "khm1", "khm2", "khm3"),
    _subDomainsmt: new Array("mt0", "mt1", "mt2", "mt3"),
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102100
        });
        this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference));

        this.id = 'googleimg';
        this.tileInfo = new esri.layers.TileInfo({
            "rows": 256,
            "cols": 256,
            "compressionQuality": 0,
            "origin": {
                "x": -20037508.342787,
                "y": 20037508.342787
            },
            "spatialReference": {
                "wkid": 102100
            },
            "lods": [{
                "level": 0,
                "resolution": 156543.033928,
                "scale": 591657527.591555
            }, {
                "level": 1,
                "resolution": 78271.5169639999,
                "scale": 295828763.795777
            }, {
                "level": 2,
                "resolution": 39135.7584820001,
                "scale": 147914381.897889
            }, {
                "level": 3,
                "resolution": 19567.8792409999,
                "scale": 73957190.948944
            }, {
                "level": 4,
                "resolution": 9783.93962049996,
                "scale": 36978595.474472
            }, {
                "level": 5,
                "resolution": 4891.96981024998,
                "scale": 18489297.737236
            }, {
                "level": 6,
                "resolution": 2445.98490512499,
                "scale": 9244648.868618
            }, {
                "level": 7,
                "resolution": 1222.99245256249,
                "scale": 4622324.434309
            }, {
                "level": 8,
                "resolution": 611.49622628138,
                "scale": 2311162.217155
            }, {
                "level": 9,
                "resolution": 305.748113140558,
                "scale": 1155581.108577
            }, {
                "level": 10,
                "resolution": 152.874056570411,
                "scale": 577790.554289
            }, {
                "level": 11,
                "resolution": 76.4370282850732,
                "scale": 288895.277144
            }, {
                "level": 12,
                "resolution": 38.2185141425366,
                "scale": 144447.638572
            }, {
                "level": 13,
                "resolution": 19.1092570712683,
                "scale": 72223.819286
            }, {
                "level": 14,
                "resolution": 9.55462853563415,
                "scale": 36111.909643
            }, {
                "level": 15,
                "resolution": 4.77731426794937,
                "scale": 18055.954822
            }, {
                "level": 16,
                "resolution": 2.38865713397468,
                "scale": 9027.977411
            }, {
                "level": 17,
                "resolution": 1.19432856685505,
                "scale": 4513.988705
            }, {
                "level": 18,
                "resolution": 0.597164283559817,
                "scale": 2256.994353
            }, { "level": 19, "resolution": 0.298582141647617, "scale": 1128.497176 }]
        });

        this.loaded = true;
        this.onLoad(this);
    },

    getTileUrl: function(level, row, col) {
        var subdomain = this._subDomains[(level + col + row) % this._subDomains.length];
        //var subdomain = this._subDomainsmt[(level + col + row) % this._subDomainsmt.length];
        return "http://" + subdomain + ".googleapis.com/kh?v=803\u0026hl=zh-CN\u0026?&z=" + level + "&x=" + col + "&y=" + row;
        //return "http://" + subdomain + ".google.cn/vt/lyrs=s@203&hl=zh-CN&gl=cn&src=app&z=" + level + "&x=" + col + "&y=" + row;
        //http://mt1.google.cn/maps/vt?lyrs=s%40203&hl=zh-Hans-CN&gl=CN&&x=105235&y=52352&z=17
        //http://mt0.google.cn/vt/lyrs=s@203&hl=zh-CN&gl=cn&src=app&x=13149&y=6547&z=14&s=
    }
});
//加载谷歌标注
dojo.declare("googlebiaozhu", esri.layers.TiledMapServiceLayer, {
    _subDomains: new Array("khm0", "khm1", "khm2", "khm3"),
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102100
        });
        this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference));

        this.id = 'googleimg';
        this.tileInfo = new esri.layers.TileInfo({
            "rows": 256,
            "cols": 256,
            "compressionQuality": 0,
            "origin": {
                "x": -20037508.342787,
                "y": 20037508.342787
            },
            "spatialReference": {
                "wkid": 102100
            },
            "lods": [{
                "level": 0,
                "resolution": 156543.033928,
                "scale": 591657527.591555
            }, {
                "level": 1,
                "resolution": 78271.5169639999,
                "scale": 295828763.795777
            }, {
                "level": 2,
                "resolution": 39135.7584820001,
                "scale": 147914381.897889
            }, {
                "level": 3,
                "resolution": 19567.8792409999,
                "scale": 73957190.948944
            }, {
                "level": 4,
                "resolution": 9783.93962049996,
                "scale": 36978595.474472
            }, {
                "level": 5,
                "resolution": 4891.96981024998,
                "scale": 18489297.737236
            }, {
                "level": 6,
                "resolution": 2445.98490512499,
                "scale": 9244648.868618
            }, {
                "level": 7,
                "resolution": 1222.99245256249,
                "scale": 4622324.434309
            }, {
                "level": 8,
                "resolution": 611.49622628138,
                "scale": 2311162.217155
            }, {
                "level": 9,
                "resolution": 305.748113140558,
                "scale": 1155581.108577
            }, {
                "level": 10,
                "resolution": 152.874056570411,
                "scale": 577790.554289
            }, {
                "level": 11,
                "resolution": 76.4370282850732,
                "scale": 288895.277144
            }, {
                "level": 12,
                "resolution": 38.2185141425366,
                "scale": 144447.638572
            }, {
                "level": 13,
                "resolution": 19.1092570712683,
                "scale": 72223.819286
            }, {
                "level": 14,
                "resolution": 9.55462853563415,
                "scale": 36111.909643
            }, {
                "level": 15,
                "resolution": 4.77731426794937,
                "scale": 18055.954822
            }, {
                "level": 16,
                "resolution": 2.38865713397468,
                "scale": 9027.977411
            }, {
                "level": 17,
                "resolution": 1.19432856685505,
                "scale": 4513.988705
            }, {
                "level": 18,
                "resolution": 0.597164283559817,
                "scale": 2256.994353
            }, { "level": 19, "resolution": 0.298582141647617, "scale": 1128.497176 }]
        });

        this.loaded = true;
        this.onLoad(this);
    },

    getTileUrl: function(level, row, col) {
        var subdomain = this._subDomains[(level + col + row) % this._subDomains.length];
        //http://mt0.google.cn/vt/imgtp=png32&lyrs=h@234000000&hl=zh-CN&gl=CN&src=app&x=20&y=12&z=5&s=
        //http://mt1.google.cn/vt/imgtp=png32&lyrs=h@247000000&hl=zh-CN&gl=CN&src=app&x=407&y=209&z=9&s=Galile
        return "http://mt0.google.cn/vt/imgtp=png32&lyrs=h@247000000&hl=zh-CN&gl=CN&src=app&x=" + col + "&y=" + row + "&z=" + level + '&s=';
    }
});
//加载天地图影像图
dojo.declare("tiandiimg", esri.layers.TiledMapServiceLayer, {
    _subDomains: new Array("t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7"),
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102100
        });
        this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference);
        this.initialExtent = new esri.geometry.Extent(8099173.322237327, 5544220.40487292, 14282623.1623933, 2775365.4922714317, this.spatialReference);

        this.id = 'tiandiimg';
        this.tileInfo = new esri.layers.TileInfo({
            "rows": 256,
            "cols": 256,
            "compressionQuality": 0,
            "origin": {
                "x": -20037508.342787,
                "y": 20037508.342787
            },
            "opacity": 1,
            "spatialReference": {
                "wkid": 102100
            },
            "lods": [{
                    "level": 0,
                    "resolution": 156543.033928,
                    "scale": 591657527.591555
                }, {
                    "level": 1,
                    "resolution": 78271.5169639999,
                    "scale": 295828763.795777
                }, {
                    "level": 2,
                    "resolution": 39135.7584820001,
                    "scale": 147914381.897889
                }, {
                    "level": 3,
                    "resolution": 19567.8792409999,
                    "scale": 73957190.948944
                }, {
                    "level": 4,
                    "resolution": 9783.93962049996,
                    "scale": 36978595.474472
                }, {
                    "level": 5,
                    "resolution": 4891.96981024998,
                    "scale": 18489297.737236
                }, {
                    "level": 6,
                    "resolution": 2445.98490512499,
                    "scale": 9244648.868618
                }, {
                    "level": 7,
                    "resolution": 1222.99245256249,
                    "scale": 4622324.434309
                }, {
                    "level": 8,
                    "resolution": 611.49622628138,
                    "scale": 2311162.217155
                }, {
                    "level": 9,
                    "resolution": 305.748113140558,
                    "scale": 1155581.108577
                }, {
                    "level": 10,
                    "resolution": 152.874056570411,
                    "scale": 577790.554289
                }, {
                    "level": 11,
                    "resolution": 76.4370282850732,
                    "scale": 288895.277144
                }, {
                    "level": 12,
                    "resolution": 38.2185141425366,
                    "scale": 144447.638572
                }, {
                    "level": 13,
                    "resolution": 19.1092570712683,
                    "scale": 72223.819286
                }, {
                    "level": 14,
                    "resolution": 9.55462853563415,
                    "scale": 36111.909643
                }, {
                    "level": 15,
                    "resolution": 4.77731426794937,
                    "scale": 18055.954822
                }, {
                    "level": 16,
                    "resolution": 2.38865713397468,
                    "scale": 9027.977411
                }, {
                    "level": 17,
                    "resolution": 1.19432856685505,
                    "scale": 4513.988705
                }, {
                    "level": 18,
                    "resolution": 0.597164283559817,
                    "scale": 2256.994353
                },
                { "level": 19, "resolution": 0.298582141647617, "scale": 1128.497176 }
            ]
        });

        this.loaded = true;
        this.onLoad(this);
    },

    getTileUrl: function(level, row, col) {
        var subdomain = this._subDomains[(level + col + row) % this._subDomains.length];
        return "http://" + subdomain + ".tianditu.cn/img_w/wmts?" + "SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=img&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" +
            "&TILEMATRIX=" +
            level +
            "&TILEROW=" +
            row +
            "&TILECOL=" +
            col;
    }
});
//加载天地图地形图
dojo.declare("tiandidixing", esri.layers.TiledMapServiceLayer, {
    _subDomains: new Array("t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7"),
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102100
        });
        this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference);
        this.initialExtent = new esri.geometry.Extent(8099173.322237327, 5544220.40487292, 14282623.1623933, 2775365.4922714317, this.spatialReference);

        this.id = 'tiandidixing';
        this.tileInfo = new esri.layers.TileInfo({
            "rows": 256,
            "cols": 256,
            "compressionQuality": 0,
            "origin": {
                "x": -20037508.342787,
                "y": 20037508.342787
            },
            "opacity": 1,
            "spatialReference": {
                "wkid": 102100
            },
            "lods": [{
                    "level": 0,
                    "resolution": 156543.033928,
                    "scale": 591657527.591555
                }, {
                    "level": 1,
                    "resolution": 78271.5169639999,
                    "scale": 295828763.795777
                }, {
                    "level": 2,
                    "resolution": 39135.7584820001,
                    "scale": 147914381.897889
                }, {
                    "level": 3,
                    "resolution": 19567.8792409999,
                    "scale": 73957190.948944
                }, {
                    "level": 4,
                    "resolution": 9783.93962049996,
                    "scale": 36978595.474472
                }, {
                    "level": 5,
                    "resolution": 4891.96981024998,
                    "scale": 18489297.737236
                }, {
                    "level": 6,
                    "resolution": 2445.98490512499,
                    "scale": 9244648.868618
                }, {
                    "level": 7,
                    "resolution": 1222.99245256249,
                    "scale": 4622324.434309
                }, {
                    "level": 8,
                    "resolution": 611.49622628138,
                    "scale": 2311162.217155
                }, {
                    "level": 9,
                    "resolution": 305.748113140558,
                    "scale": 1155581.108577
                }, {
                    "level": 10,
                    "resolution": 152.874056570411,
                    "scale": 577790.554289
                }, {
                    "level": 11,
                    "resolution": 76.4370282850732,
                    "scale": 288895.277144
                }, {
                    "level": 12,
                    "resolution": 38.2185141425366,
                    "scale": 144447.638572
                }, {
                    "level": 13,
                    "resolution": 19.1092570712683,
                    "scale": 72223.819286
                }, {
                    "level": 14,
                    "resolution": 9.55462853563415,
                    "scale": 36111.909643
                }, {
                    "level": 15,
                    "resolution": 4.77731426794937,
                    "scale": 18055.954822
                }, {
                    "level": 16,
                    "resolution": 2.38865713397468,
                    "scale": 9027.977411
                }, {
                    "level": 17,
                    "resolution": 1.19432856685505,
                    "scale": 4513.988705
                }, {
                    "level": 18,
                    "resolution": 0.597164283559817,
                    "scale": 2256.994353
                },
                { "level": 19, "resolution": 0.298582141647617, "scale": 1128.497176 }
            ]
        });

        this.loaded = true;
        this.onLoad(this);
    },
    getTileUrl: function(level, row, col) {
        var subdomain = this._subDomains[(level + col + row) % this._subDomains.length];
        return "http://" + subdomain + ".tianditu.cn/vec_c/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=c&FORMAT=tiles" +
            "&TILEMATRIX=" +
            level +
            "&TILEROW=" +
            row +
            "&TILECOL=" +
            col;
    }
});
//加载天地图标注图
dojo.declare("tiandibiaozhu", esri.layers.TiledMapServiceLayer, {
    _subDomains: new Array("t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7"),
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102100
        });
        this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference);
        this.initialExtent = new esri.geometry.Extent(8099173.322237327, 5544220.40487292, 14282623.1623933, 2775365.4922714317, this.spatialReference);

        this.id = 'tiandibiaozhu';
        this.tileInfo = new esri.layers.TileInfo({
            "rows": 256,
            "cols": 256,
            "compressionQuality": 0,
            "origin": {
                "x": -20037508.342787,
                "y": 20037508.342787
            },
            "opacity": 0.4,
            "spatialReference": {
                "wkid": 102100
            },
            "lods": [{
                    "level": 0,
                    "resolution": 156543.033928,
                    "scale": 591657527.591555
                }, {
                    "level": 1,
                    "resolution": 78271.5169639999,
                    "scale": 295828763.795777
                }, {
                    "level": 2,
                    "resolution": 39135.7584820001,
                    "scale": 147914381.897889
                }, {
                    "level": 3,
                    "resolution": 19567.8792409999,
                    "scale": 73957190.948944
                }, {
                    "level": 4,
                    "resolution": 9783.93962049996,
                    "scale": 36978595.474472
                }, {
                    "level": 5,
                    "resolution": 4891.96981024998,
                    "scale": 18489297.737236
                }, {
                    "level": 6,
                    "resolution": 2445.98490512499,
                    "scale": 9244648.868618
                }, {
                    "level": 7,
                    "resolution": 1222.99245256249,
                    "scale": 4622324.434309
                }, {
                    "level": 8,
                    "resolution": 611.49622628138,
                    "scale": 2311162.217155
                }, {
                    "level": 9,
                    "resolution": 305.748113140558,
                    "scale": 1155581.108577
                }, {
                    "level": 10,
                    "resolution": 152.874056570411,
                    "scale": 577790.554289
                }, {
                    "level": 11,
                    "resolution": 76.4370282850732,
                    "scale": 288895.277144
                }, {
                    "level": 12,
                    "resolution": 38.2185141425366,
                    "scale": 144447.638572
                }, {
                    "level": 13,
                    "resolution": 19.1092570712683,
                    "scale": 72223.819286
                }, {
                    "level": 14,
                    "resolution": 9.55462853563415,
                    "scale": 36111.909643
                }, {
                    "level": 15,
                    "resolution": 4.77731426794937,
                    "scale": 18055.954822
                }, {
                    "level": 16,
                    "resolution": 2.38865713397468,
                    "scale": 9027.977411
                }, {
                    "level": 17,
                    "resolution": 1.19432856685505,
                    "scale": 4513.988705
                }, {
                    "level": 18,
                    "resolution": 0.597164283559817,
                    "scale": 2256.994353
                },
                { "level": 19, "resolution": 0.298582141647617, "scale": 1128.497176 }
            ]
        });

        this.loaded = true;
        this.onLoad(this);
    },

    getTileUrl: function(level, row, col) {
        var subdomain = this._subDomains[(level + col + row) % this._subDomains.length];
        return "http://" + subdomain + ".tianditu.com/cia_w/wmts?" + "SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cia&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles" +
            "&TILEMATRIX=" +
            level +
            "&TILEROW=" +
            row +
            "&TILECOL=" +
            col;
    }
});
//加载qq地图卫星图
dojo.declare("QQLayer", esri.layers.TiledMapServiceLayer, {
    _subDomains: new Array("p0", "p1", "p2", "p3"),
    scope: new Array(0, 0, 0, 0, 0, 3, 0, 3, 0, 3, 0, 3, 0, 7, 0, 7, 0, 15, 0, 15, 0, 31, 0, 31, 0, 63, 4, 59, 0, 127, 12, 115, 0, 225, 28, 227, 356, 455, 150, 259, 720, 899, 320, 469, 1440, 1799, 650, 929, 2880, 3589, 1200, 2069, 5760, 7179, 2550, 3709, 11520, 14349, 5100, 7999, 23060, 28689, 10710, 15429, 46120, 57369, 20290, 29849, 89990, 124729, 41430, 60689, 184228, 229827, 84169, 128886),
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102100
        });
        this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-20037508, -20037508, 20037508, 20037508, this.spatialReference));
        this.tileInfo = new esri.layers.TileInfo({
            "rows": 256,
            "cols": 256,
            "compressionQuality": 0,
            "origin": {
                "x": -20037808.342787,
                "y": 20037798.342787
            },
            "spatialReference": {
                "wkid": 102100
            },
            "lods": [{
                "level": 0,
                "resolution": 156543.033928,
                "scale": 591657527.591555
            }, {
                "level": 1,
                "resolution": 78271.5169639999,
                "scale": 295828763.795777
            }, {
                "level": 2,
                "resolution": 39135.7584820001,
                "scale": 147914381.897889
            }, {
                "level": 3,
                "resolution": 19567.8792409999,
                "scale": 73957190.948944
            }, {
                "level": 4,
                "resolution": 9783.93962049996,
                "scale": 36978595.474472
            }, {
                "level": 5,
                "resolution": 4891.96981024998,
                "scale": 18489297.737236
            }, {
                "level": 6,
                "resolution": 2445.98490512499,
                "scale": 9244648.868618
            }, {
                "level": 7,
                "resolution": 1222.99245256249,
                "scale": 4622324.434309
            }, {
                "level": 8,
                "resolution": 611.49622628138,
                "scale": 2311162.217155
            }, {
                "level": 9,
                "resolution": 305.748113140558,
                "scale": 1155581.108577
            }, {
                "level": 10,
                "resolution": 152.874056570411,
                "scale": 577790.554289
            }, {
                "level": 11,
                "resolution": 76.4370282850732,
                "scale": 288895.277144
            }, {
                "level": 12,
                "resolution": 38.2185141425366,
                "scale": 144447.638572
            }, {
                "level": 13,
                "resolution": 19.1092570712683,
                "scale": 72223.819286
            }, {
                "level": 14,
                "resolution": 9.55462853563415,
                "scale": 36111.909643
            }, {
                "level": 15,
                "resolution": 4.77731426794937,
                "scale": 18055.954822
            }, {
                "level": 16,
                "resolution": 2.38865713397468,
                "scale": 9027.977411
            }, {
                "level": 17,
                "resolution": 1.19432856685505,
                "scale": 4513.988705
            }, {
                "level": 18,
                "resolution": 0.597164283559817,
                "scale": 2256.994353
            }, {
                "level": 19,
                "resolution": 0.298582141647617,
                "scale": 1128.497176
            }]
        });
        this.loaded = true;
        this.onLoad(this);
    },

    getTileUrl: function(level, row, col) {
        var subdomain = this._subDomains[(level + col + row) % this._subDomains.length];
        var f = level * 4;
        var i = this.scope[f++];
        var j = this.scope[f++];
        var l = this.scope[f++];
        var scope = this.scope[f];
        var tileNo = "";
        if (col >= i && col <= j && row >= l && row <= scope) {
            row = Math.pow(2, level) - 1 - row;
            tileNo = level + "/" + Math.floor(col / 16) + "/" + Math.floor(row / 16) + "/" + col + "_" + row + ".jpg";
        }
        return "http://" + subdomain + ".map.soso.com/sateTiles/" + tileNo;
        //return "http://"+subdomain+".map.qq.com/maptiles/"+tileNo;
        //http://p1.map.soso.com/maptilesv2/10/51/38/823_615.png?version=20130701
        //http://p2.map.soso.com/sateTranTiles/10/51/38/820_616.png?version=20130701
        //http://p2.map.soso.com/sateTiles/10/51/38/820_616.jpg?version=20130701
    }
});
//加载qq地图标注图
dojo.declare("QQLayerbiaozhu", esri.layers.TiledMapServiceLayer, {
    _subDomains: new Array("p0", "p1", "p2", "p3"),
    scope: new Array(0, 0, 0, 0, 0, 3, 0, 3, 0, 3, 0, 3, 0, 7, 0, 7, 0, 15, 0, 15, 0, 31, 0, 31, 0, 63, 4, 59, 0, 127, 12, 115, 0, 225, 28, 227, 356, 455, 150, 259, 720, 899, 320, 469, 1440, 1799, 650, 929, 2880, 3589, 1200, 2069, 5760, 7179, 2550, 3709, 11520, 14349, 5100, 7999, 23060, 28689, 10710, 15429, 46120, 57369, 20290, 29849, 89990, 124729, 41430, 60689, 184228, 229827, 84169, 128886),
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102113
        });
        this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference));
        this.tileInfo = new esri.layers.TileInfo({
            "rows": 256,
            "cols": 256,
            "compressionQuality": 0,
            "origin": {
                "x": -20037808.342787,
                "y": 20037798.342787
            },
            "spatialReference": {
                "wkid": 102113
            },
            "lods": [{
                "level": 0,
                "resolution": 156543.033928,
                "scale": 591657527.591555
            }, {
                "level": 1,
                "resolution": 78271.5169639999,
                "scale": 295828763.795777
            }, {
                "level": 2,
                "resolution": 39135.7584820001,
                "scale": 147914381.897889
            }, {
                "level": 3,
                "resolution": 19567.8792409999,
                "scale": 73957190.948944
            }, {
                "level": 4,
                "resolution": 9783.93962049996,
                "scale": 36978595.474472
            }, {
                "level": 5,
                "resolution": 4891.96981024998,
                "scale": 18489297.737236
            }, {
                "level": 6,
                "resolution": 2445.98490512499,
                "scale": 9244648.868618
            }, {
                "level": 7,
                "resolution": 1222.99245256249,
                "scale": 4622324.434309
            }, {
                "level": 8,
                "resolution": 611.49622628138,
                "scale": 2311162.217155
            }, {
                "level": 9,
                "resolution": 305.748113140558,
                "scale": 1155581.108577
            }, {
                "level": 10,
                "resolution": 152.874056570411,
                "scale": 577790.554289
            }, {
                "level": 11,
                "resolution": 76.4370282850732,
                "scale": 288895.277144
            }, {
                "level": 12,
                "resolution": 38.2185141425366,
                "scale": 144447.638572
            }, {
                "level": 13,
                "resolution": 19.1092570712683,
                "scale": 72223.819286
            }, {
                "level": 14,
                "resolution": 9.55462853563415,
                "scale": 36111.909643
            }, {
                "level": 15,
                "resolution": 4.77731426794937,
                "scale": 18055.954822
            }, {
                "level": 16,
                "resolution": 2.38865713397468,
                "scale": 9027.977411
            }, {
                "level": 17,
                "resolution": 1.19432856685505,
                "scale": 4513.988705
            }, {
                "level": 18,
                "resolution": 0.597164283559817,
                "scale": 2256.994353
            }, {
                "level": 19,
                "resolution": 0.298582141647617,
                "scale": 1128.497176
            }]
        });
        this.loaded = true;
        this.onLoad(this);
    },

    getTileUrl: function(level, row, col) {

        var subdomain = this._subDomains[(level + col + row) % this._subDomains.length];
        var f = level * 4;
        var i = this.scope[f++];
        var j = this.scope[f++];
        var l = this.scope[f++];
        var scope = this.scope[f];
        var tileNo = "";
        if (col >= i && col <= j && row >= l && row <= scope) {
            row = Math.pow(2, level) - 1 - row;
            tileNo = level + "/" + Math.floor(col / 16) + "/" + Math.floor(row / 16) + "/" + col + "_" + row + ".png";
        }
        return "http://" + subdomain + ".map.soso.com/sateTranTiles/" + tileNo;
        //return "http://"+subdomain+".map.qq.com/maptiles/"+tileNo;
        //http://p1.map.soso.com/maptilesv2/10/51/38/823_615.png?version=20130701
        //http://p2.map.soso.com/sateTranTiles/10/51/38/820_616.png?version=20130701
        //http://p2.map.soso.com/sateTiles/10/51/38/820_616.jpg?version=20130701
    }
});
//百度卫星图
dojo.declare("BaiduLayer", esri.layers.TiledMapServiceLayer, {
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102100
        });
        this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-33554432, -33554432, 33554432, 33554432, this.spatialReference));
        this.tileInfo = new esri.layers.TileInfo({
            "rows": 256,
            "cols": 256,
            "compressionQuality": 0,
            "origin": {
                "x": -22395798.3,
                "y": 19276998.3
            },
            "spatialReference": {
                "wkid": 102100
            },
            "lods": [{
                "level": 0,
                "resolution": 156543.033928,
                "scale": 591657527.591555
            }, {
                "level": 1,
                "resolution": 78271.5169639999,
                "scale": 295828763.795777
            }, {
                "level": 2,
                "resolution": 39135.7584820001,
                "scale": 147914381.897889
            }, {
                "level": 3,
                "resolution": 19567.8792409999,
                "scale": 73957190.948944
            }, {
                "level": 4,
                "resolution": 9783.93962049996,
                "scale": 36978595.474472
            }, {
                "level": 5,
                "resolution": 4891.96981024998,
                "scale": 18489297.737236
            }, {
                "level": 6,
                "resolution": 2445.98490512499,
                "scale": 9244648.868618
            }, {
                "level": 7,
                "resolution": 1222.99245256249,
                "scale": 4622324.434309
            }, {
                "level": 8,
                "resolution": 611.49622628138,
                "scale": 2311162.217155
            }, {
                "level": 9,
                "resolution": 305.748113140558,
                "scale": 1155581.108577
            }, {
                "level": 10,
                "resolution": 152.874056570411,
                "scale": 577790.554289
            }, {
                "level": 11,
                "resolution": 76.4370282850732,
                "scale": 288895.277144
            }, {
                "level": 12,
                "resolution": 38.2185141425366,
                "scale": 144447.638572
            }, {
                "level": 13,
                "resolution": 19.1092570712683,
                "scale": 72223.819286
            }, {
                "level": 14,
                "resolution": 9.55462853563415,
                "scale": 36111.909643
            }, {
                "level": 15,
                "resolution": 4.77731426794937,
                "scale": 18055.954822
            }, {
                "level": 16,
                "resolution": 2.38865713397468,
                "scale": 9027.977411
            }, {
                "level": 17,
                "resolution": 1.19432856685505,
                "scale": 4513.988705
            }, {
                "level": 18,
                "resolution": 0.597164283559817,
                "scale": 2256.994353
            }, {
                "level": 19,
                "resolution": 0.298582141647617,
                "scale": 1128.497176
            }]
        });
        this.loaded = true;
        this.onLoad(this);
    },
    getTileUrl: function(level, row, col) {
        var zoom = level - 1;
        var offsetX = Math.pow(2, zoom);
        var offsetY = offsetX - 1;
        var numX = col - offsetX;
        var numY = (-row) + offsetY;
        zoom = level + 1;
        var num = (col + row) % 8 + 1;
        var url = "http://shangetu2.map.bdimg.com/it/u=x=" + numX + ";y=" + numY + ";z=" + zoom + ";v=009;type=sate&fm=46&udt=20130822";
        //http://shangetu2.map.bdimg.com/it/u=x=187;y=61;z=10;v=009;type=sate&fm=46&udt=20130822
        return url;
    }
});
dojo.declare("arcgisimg", esri.layers.TiledMapServiceLayer, {
    _subDomains: new Array("khm0", "khm1", "khm2", "khm3"),
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102100
        });
        this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference));

        this.id = 'googleimg';
        this.tileInfo = new esri.layers.TileInfo({
            "rows": 256,
            "cols": 256,
            "compressionQuality": 0,
            "origin": {
                "x": -20037508.342787,
                "y": 20037508.342787
            },
            "spatialReference": {
                "wkid": 102100
            },
            "lods": [{
                    "level": 0,
                    "resolution": 156543.033928,
                    "scale": 591657527.591555
                }, {
                    "level": 1,
                    "resolution": 78271.5169639999,
                    "scale": 295828763.795777
                }, {
                    "level": 2,
                    "resolution": 39135.7584820001,
                    "scale": 147914381.897889
                }, {
                    "level": 3,
                    "resolution": 19567.8792409999,
                    "scale": 73957190.948944
                }, {
                    "level": 4,
                    "resolution": 9783.93962049996,
                    "scale": 36978595.474472
                }, {
                    "level": 5,
                    "resolution": 4891.96981024998,
                    "scale": 18489297.737236
                }, {
                    "level": 6,
                    "resolution": 2445.98490512499,
                    "scale": 9244648.868618
                }, {
                    "level": 7,
                    "resolution": 1222.99245256249,
                    "scale": 4622324.434309
                }, {
                    "level": 8,
                    "resolution": 611.49622628138,
                    "scale": 2311162.217155
                }, {
                    "level": 9,
                    "resolution": 305.748113140558,
                    "scale": 1155581.108577
                }, {
                    "level": 10,
                    "resolution": 152.874056570411,
                    "scale": 577790.554289
                }, {
                    "level": 11,
                    "resolution": 76.4370282850732,
                    "scale": 288895.277144
                }, {
                    "level": 12,
                    "resolution": 38.2185141425366,
                    "scale": 144447.638572
                }, {
                    "level": 13,
                    "resolution": 19.1092570712683,
                    "scale": 72223.819286
                }, {
                    "level": 14,
                    "resolution": 9.55462853563415,
                    "scale": 36111.909643
                }, {
                    "level": 15,
                    "resolution": 4.77731426794937,
                    "scale": 18055.954822
                }, {
                    "level": 16,
                    "resolution": 2.38865713397468,
                    "scale": 9027.977411
                }, {
                    "level": 17,
                    "resolution": 1.19432856685505,
                    "scale": 4513.988705
                }, {
                    "level": 18,
                    "resolution": 0.597164283559817,
                    "scale": 2256.994353
                },
                { "level": 19, "resolution": 0.298582141647617, "scale": 1128.497176 }
            ]
        });

        this.loaded = true;
        this.onLoad(this);
    },

    getTileUrl: function(level, row, col) {
        var subdomain = this._subDomains[(level + col + row) % this._subDomains.length];
        //http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/16/26791/51776
        return "http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/" + level + "/" + row + "/" + col;
        //http://ecn.t1.tiles.virtualearth.net/tiles/a1302.jpeg?g=1647
        //return "http://" + subdomain + ".googleapis.com/kh?v=132\u0026hl=zh-CN\u0026?&z=" + level + "&x=" + col + "&y=" + row;
    }
});
dojo.declare("arcgisdixing", esri.layers.TiledMapServiceLayer, {
    _subDomains: new Array("khm0", "khm1", "khm2", "khm3"),
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102100
        });
        this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787, this.spatialReference));

        this.id = 'googleimg';
        this.tileInfo = new esri.layers.TileInfo({
            "rows": 256,
            "cols": 256,
            "compressionQuality": 0,
            "origin": {
                "x": -20037508.342787,
                "y": 20037508.342787
            },
            "spatialReference": {
                "wkid": 102100
            },
            "lods": [{
                    "level": 0,
                    "resolution": 156543.033928,
                    "scale": 591657527.591555
                }, {
                    "level": 1,
                    "resolution": 78271.5169639999,
                    "scale": 295828763.795777
                }, {
                    "level": 2,
                    "resolution": 39135.7584820001,
                    "scale": 147914381.897889
                }, {
                    "level": 3,
                    "resolution": 19567.8792409999,
                    "scale": 73957190.948944
                }, {
                    "level": 4,
                    "resolution": 9783.93962049996,
                    "scale": 36978595.474472
                }, {
                    "level": 5,
                    "resolution": 4891.96981024998,
                    "scale": 18489297.737236
                }, {
                    "level": 6,
                    "resolution": 2445.98490512499,
                    "scale": 9244648.868618
                }, {
                    "level": 7,
                    "resolution": 1222.99245256249,
                    "scale": 4622324.434309
                }, {
                    "level": 8,
                    "resolution": 611.49622628138,
                    "scale": 2311162.217155
                }, {
                    "level": 9,
                    "resolution": 305.748113140558,
                    "scale": 1155581.108577
                }, {
                    "level": 10,
                    "resolution": 152.874056570411,
                    "scale": 577790.554289
                }, {
                    "level": 11,
                    "resolution": 76.4370282850732,
                    "scale": 288895.277144
                }, {
                    "level": 12,
                    "resolution": 38.2185141425366,
                    "scale": 144447.638572
                }, {
                    "level": 13,
                    "resolution": 19.1092570712683,
                    "scale": 72223.819286
                }, {
                    "level": 14,
                    "resolution": 9.55462853563415,
                    "scale": 36111.909643
                }, {
                    "level": 15,
                    "resolution": 4.77731426794937,
                    "scale": 18055.954822
                }, {
                    "level": 16,
                    "resolution": 2.38865713397468,
                    "scale": 9027.977411
                }, {
                    "level": 17,
                    "resolution": 1.19432856685505,
                    "scale": 4513.988705
                }, {
                    "level": 18,
                    "resolution": 0.597164283559817,
                    "scale": 2256.994353
                },
                { "level": 19, "resolution": 0.298582141647617, "scale": 1128.497176 }
            ]
        });

        this.loaded = true;
        this.onLoad(this);
    },

    getTileUrl: function(level, row, col) {
        var subdomain = this._subDomains[(level + col + row) % this._subDomains.length];
        //http://ecn.t1.tiles.virtualearth.net/tiles/a1302.jpeg?g=1647
        return "http://ecn.t1.tiles.virtualearth.net/tiles/a" + level + col + row + ".jpeg?g=1647";
        //return "http://" + subdomain + ".googleapis.com/kh?v=132\u0026hl=zh-CN\u0026?&z=" + level + "&x=" + col + "&y=" + row;
    }
});
//加载高德地图影像其实MapABC,百度地图和QQ地图就用的是高德的卫星图数据
dojo.declare("gaode", esri.layers.TiledMapServiceLayer, {
    _subDomains: new Array("emap0", "emap1", "emap2", "emap3"),
    constructor: function() {
        this.spatialReference = new esri.SpatialReference({
            wkid: 102100
        });
        this.initialExtent = (this.fullExtent = new esri.geometry.Extent(-20037508, -20037508, 20037508, 20037508, this.spatialReference));

        this.tileInfo = new esri.layers.TileInfo({
            "rows": 256,
            "cols": 256,
            "compressionQuality": 0,
            "origin": {
                "x": -20037808.342787,
                "y": 20037798.342787
            },
            "spatialReference": {
                "wkid": 102100
            },
            "lods": [{
                "level": 0,
                "resolution": 156543.033928,
                "scale": 591657527.591555
            }, {
                "level": 1,
                "resolution": 78271.5169639999,
                "scale": 295828763.795777
            }, {
                "level": 2,
                "resolution": 39135.7584820001,
                "scale": 147914381.897889
            }, {
                "level": 3,
                "resolution": 19567.8792409999,
                "scale": 73957190.948944
            }, {
                "level": 4,
                "resolution": 9783.93962049996,
                "scale": 36978595.474472
            }, {
                "level": 5,
                "resolution": 4891.96981024998,
                "scale": 18489297.737236
            }, {
                "level": 6,
                "resolution": 2445.98490512499,
                "scale": 9244648.868618
            }, {
                "level": 7,
                "resolution": 1222.99245256249,
                "scale": 4622324.434309
            }, {
                "level": 8,
                "resolution": 611.49622628138,
                "scale": 2311162.217155
            }, {
                "level": 9,
                "resolution": 305.748113140558,
                "scale": 1155581.108577
            }, {
                "level": 10,
                "resolution": 152.874056570411,
                "scale": 577790.554289
            }, {
                "level": 11,
                "resolution": 76.4370282850732,
                "scale": 288895.277144
            }, {
                "level": 12,
                "resolution": 38.2185141425366,
                "scale": 144447.638572
            }, {
                "level": 13,
                "resolution": 19.1092570712683,
                "scale": 72223.819286
            }, {
                "level": 14,
                "resolution": 9.55462853563415,
                "scale": 36111.909643
            }, {
                "level": 15,
                "resolution": 4.77731426794937,
                "scale": 18055.954822
            }, {
                "level": 16,
                "resolution": 2.38865713397468,
                "scale": 9027.977411
            }, {
                "level": 17,
                "resolution": 1.19432856685505,
                "scale": 4513.988705
            }, {
                "level": 18,
                "resolution": 0.597164283559817,
                "scale": 2256.994353
            }, {
                "level": 19,
                "resolution": 0.298582141647617,
                "scale": 1128.497176
            }]
        });

        this.loaded = true;
        this.onLoad(this);
    },
    getTileUrl: function(level, row, col) {
        var subdomain = this._subDomains[(level + col + row) % this._subDomains.length];
        //这里style=6是卫星图，8是标注图
        return "http://webst03.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=6&z=" + level + "&x=" + col + "&y=" + row;
    }
});